package com.yj.schedule;

import com.yj.transport.service.TaskTransportInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * Created by zhengguanyong on 2017/12/26.
 */
@Component
public class TransportInfoTask {
    @Autowired
    TaskTransportInfoService taskTransportInfoService;
    //每20分钟执行 TaskTransportInfoService
    @Scheduled(cron = "0/20 * * * * ?")
    public void aaa() {
        System.out.println("cron当前时间:"+LocalDateTime.now());
        taskTransportInfoService.getLocalShipPosition();
    }
}
